<?php
/**
 * 活动小程序相关服务类
 * Actutils.php BY My
 * Created by sen at 2021/3/23
 * AgeClub.net @ 2021
 */

namespace app\api\controller\bzh\Exhibition;


use app\api\library\Utils;
use app\common\controller\Api;
use think\Db;
use think\Log;
use think\Validate;
use think\Cache;

class Exhibition extends Api
{
    protected $noNeedLogin = ['ExhibitionList',];
    protected $noNeedRight = '*';

    /**
     * 获取展会列表
     */
    public function ExhibitionList()
    {
        if ($this->request->isGet()) {

            $total = Db::name('bzh_exhibition')
                ->where('status', 'normal')
                ->count();

            $list = Db::name('bzh_exhibition')
                ->where('status', 'normal')
                ->find();

            if(empty($list)){
                $this->error('暂无会展信息',406);
            }
            $list = collection($list)->toArray();
            $result = array("total" => $total, "rows" => $list);
            $this->success('获取信息成功', $result, 200);
        }else{
            $this->error('请求方式有误',305);
        }

    }

}
